<!--
/*
 * SPDX-License-Identifier: GPL-3.0-or-later
 * Copyright 2014 The moOde audio player project / Tim Curtis
 *
 * 汉化：Androidnews
 *
*/
-->
<div id="container">
<div class="container">
	<h1 class="snd-config">多房间</h1>

	<p>
		多房间音频系统由一个发送器和一个或多个接收器组成.
		发送器应为未连接到扬声器或耳机的专用Pi.
		有关其他信息<a href="./setup_multiroom.txt" class="target-blank-link" target="_blank">查看多房间设置指南</a>
	</p>

	<form class="form-horizontal" method="post">
		<legend>发送器</legend>
		<div class="control-group">
			<label class="control-label">发送器守护程序</label>
			<div class="controls">
				<div class="toggle">
					<label class="toggle-radio toggle-multiroom-tx" for="toggle-multiroom-tx-2">开</label>$_select[multiroom_tx_on]
					<label class="toggle-radio toggle-multiroom-tx" for="toggle-multiroom-tx-1">关</label>$_select[multiroom_tx_off]
				</div>
				<button id="btn-set-multiroom-tx" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_multiroom_tx" value="novalue" $_multiroom_tx_disable><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
			</div>

			<label class="control-label">环回</label>
			<div class="controls">
				<div class="toggle">
					<label class="toggle-radio toggle-alsa-loopback" for="toggle-alsa-loopback-2">开</label>$_select[alsa_loopback_on]
					<label class="toggle-radio toggle-alsa-loopback" for="toggle-alsa-loopback-1">关</label>$_select[alsa_loopback_off]
				</div>
				<button id="btn-set-alsa-loopback" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_alsa_loopback" value="novalue" $_alsa_loopback_disable><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
				<span class="config-help-static">
					在打开ALSA环回之前,确保音频配置中的所有DSP都已关闭.
                </span>
			</div>

			<div class="controls">
				<button class="btn btn-primary btn-medium config-btn btn-submit" type="submit" name="multiroom_tx_discover" value="novalue">发现</button>
				<span class="config-btn-after">接收器</span>
				<span class="config-help-static">
					$_rx_hostnames
				</span>
			</div>

			<label class="control-label" for="multiroom-initvol">初始音量</label>
			<div class="controls">
				<input id="multiroom-initvol" class="config-input-large" type="number" maxlength="3" min="0" max="100" name="multiroom_initvol" value="$_multiroom_initvol" $_multiroom_initvol_disable>
				<button class="btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_multiroom_initvol" value="novalue" $_multiroom_initvol_disable><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
				<span class="config-help-static">
					设置发送器和接收器的初始音量.请注意,接收器必须将“主音量选择加入”设置为“是”.
				</span>
			</div>

			<div class="controls">
				<a data-toggle="modal" href="#restart-tx" $_tx_restart_link_disable><button class="btn btn-medium btn-primary config-btn" $_tx_restart_btn_disable>重启</button></a>
				<span class="config-btn-after">发送器</span>
			</div>

			<label class="control-label">高级选项</label>
			<div class="controls">
				<label id="multiroom-tx-adv-options-label" class="btn btn-primary btn-medium config-btn">$_SESSION[tx_adv_toggle]</label>
			</div>

			<div id="multiroom-tx-adv-options" class="$_tx_adv_options_hide">
				<label class="control-label" for="multiroom-tx-bfr">ALSA缓冲 (ms)</label>
				<div class="controls">
					<select id="multiroom-tx-bfr" class="config-select-large" name="multiroom_tx_bfr" onchange="autoClick('#btn-set-multiroom-tx-bfr');">
						$_select[multiroom_tx_bfr]
					</select>
					<button id="btn-set-multiroom-tx-bfr" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_multiroom_tx_bfr" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
					<span class="config-help-static">
						Length of the ALSA buffer in milliseconds.
					</span>
				</div>

				<label class="control-label" for="multiroom-tx-frame-size">Opus帧大小 (ms)</label>
				<div class="controls">
					<select id="multiroom-tx-frame-size" class="config-select-large" name="multiroom_tx_frame_size" onchange="autoClick('#btn-set-multiroom-tx-frame-size');">
						$_select[multiroom_tx_frame_size]
					</select>
					<button id="btn-set-multiroom-tx-frame-size" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_multiroom_tx_frame_size" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
					<span class="config-help-static">
						Length of PCM data in milliseconds to be encoded into an Opus frame.
					</span>
				</div>

				<label class="control-label" for="multiroom-tx-rtprio">实时优先级</label>
				<div class="controls">
					<input id="multiroom-tx-rtprio" class="input-small" type="number" maxlength="3" min="1" max="99" name="multiroom_tx_rtprio" value="$_multiroom_tx_rtprio">
					<button class="btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_multiroom_tx_rtprio" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
					<span class="config-help-static">
						Realtime process priority for the Sender daemon. Priorities range from 1 - 99 where higher priority preempts lower priority.
						Scheduler policy is FIFO and default priority is 45.
					</span>
				</div>

				<label class="control-label" for="multiroom-tx-query-timeout">查询超时</label>
				<div class="controls">
					<input id="multiroom-tx-query-timeout" class="input-small" type="number" maxlength="1" min="1" max="3" name="multiroom_tx_query_timeout" value="$_multiroom_tx_query_timeout">
					<button class="btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_multiroom_tx_query_timeout" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
					<span class="config-help-static">
						Maximum number of seconds to wait per Receiver when querying for Receivers.<br>
						Range is 1-3 seconds. Default is 1 second.<br>
					</span>
				</div>
			</div>
		</div>

		<legend>接收器</legend>
		<div class="control-group">
			<label class="control-label" for="multiroom-rx">接收器守护程序</label>
			<div class="controls">
				<select id="multiroom-rx" class="config-select-large" name="multiroom_rx" onchange="autoClick('#btn-set-multiroom-rx');">
					$_select[multiroom_rx]
				</select>
				<button id="btn-set-multiroom-rx" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_multiroom_rx" value="novalue" $_multiroom_rx_disable><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-multiroom-rx" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span class="config-help-static">
					要通过发送器控制接收器音量,请在音频配置中将“volume type”(音量类型)设置为“Hardware”(硬件).<br>
					<b>注意: </b>也可以使用Software or Fixed (0dB) 但无论发送方音量如何设置,音量输出都将是0dB (100%).
				</span>
				<span id="info-multiroom-rx" class="config-help-info">
					Disabling the Receiver hides it from the Receivers&nbsp;<i class="fa-solid fa-sharp fa-speakers"></i>&nbsp;screen and prevents it from being turned On.
				</span>
			</div>

			<label class="control-label">主音量</label>
			<div class="controls">
				<div class="toggle">
					<label class="toggle-radio toggle-multiroom-rx-mastervol-opt-in" for="toggle-multiroom-rx-mastervol-opt-in-2">开</label>$_select[multiroom_rx_mastervol_opt_in_on]
					<label class="toggle-radio toggle-multiroom-rx-mastervol-opt-in" for="toggle-multiroom-rx-mastervol-opt-in-1">关</label>$_select[multiroom_rx_mastervol_opt_in_off]
				</div>
				<button id="btn-set-multiroom-rx-mastervol-opt-in" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_multiroom_rx_mastervol_opt_in" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
				<span class="config-help-static">
					定接收者是否接受发送者音量控制所做的更改.
					请注意，在接收器上&nbsp;<i class="fa-solid fa-sharp fa-speakers"></i>&nbsp;用复选标记屏蔽音量旋钮 &nbsp;<i class="fa-regular fa-sharp fa-circle-check"></i>&nbsp;会出现在那些选择加入的人面前.
				</span>
			</div>

			<label class="control-label" for="multiroom-rx-alsa-output-mode">ALSA输出模式</label>
			<div class="controls">
				<select id="multiroom-rx-alsa-output-mode" class="config-select-large" name="multiroom_rx_alsa_output_mode" onchange="autoClick('#btn-set-multiroom-rx-alsa-output-mode');">
					$_select[multiroom_rx_alsa_output_mode]
				</select>
				<button id="btn-set-multiroom-rx-alsa-output-mode" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_multiroom_rx_alsa_output_mode" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-multiroom-rx-alsa-output-mode" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				<span id="info-multiroom-rx-alsa-output-mode" class="config-help-info">
					<b>Default: </b>ALSA "plughw" plugin which performs format conversions if needed to match audio device requirements.<br>
					<b>Direct: </b>ALSA "hw" plugin which does not perform format conversions. The audio device must accept the given format.<br>
					<b>IEC958: </b>ALSA "iec958" plugin which provides IEC958_SUBFRAME_LE format for HDMI audio.<br>
				</span>
			</div>

			<label class="control-label" for="multiroom-rx-alsavol">ALSA最大音量</label>
			<div class="controls">
				<input id="multiroom-rx-alsavol" class="config-input-large" type="number" maxlength="3" min="1" max="100" name="multiroom_rx_alsavol" value="$_multiroom_rx_alsavol_max" $_multiroom_rx_alsavol_disable>
				<button class="btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_multiroom_rx_alsavol" value="novalue" $_multiroom_rx_alsavol_disable><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-multiroom-rx-alsavol" href="#notarget"><i class="fa-regular fa-sharp fa-info-circle"></i></a>
				$_multiroom_rx_alsavol_msg
				<span id="info-multiroom-rx-alsavol" class="config-help-info">
					This establishes the ALSA 0dB level for this receiver when Spotify, Airplay or Bluetooth clients connect to the Sender.
					Alsamixer volume units (1 to 100) are used.
				</span>
			</div>

			<div class="controls">
				<a data-toggle="modal" href="#restart-rx" $_rx_restart_link_disable><button class="btn btn-medium btn-primary config-btn" $_rx_restart_btn_disable>重启</button></a>
				<span class="config-btn-after">Receiver</span>
			</div>

			<label class="control-label">高级选项</label>
			<div class="controls">
				<label id="multiroom-rx-adv-options-label" class="btn btn-primary btn-medium config-btn">$_SESSION[rx_adv_toggle]</label>
			</div>

			<div id="multiroom-rx-adv-options" class="$_rx_adv_options_hide">
				<label class="control-label" for="multiroom-rx-bfr">ALSA缓冲(ms)</label>
				<div class="controls">
					<select id="multiroom-rx-bfr" class="config-select-large" name="multiroom_rx_bfr" onchange="autoClick('#btn-set-multiroom-rx-bfr');">
						$_select[multiroom_rx_bfr]
					</select>
					<button id="btn-set-multiroom-rx-bfr" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_multiroom_rx_bfr" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
					<span class="config-help-static">
						Length of the ALSA buffer in milliseconds.
					</span>
				</div>

				<label class="control-label" for="multiroom-rx-jitter-bfr">RTP抖动缓冲(ms)</label>
				<div class="controls">
					<select id="multiroom-rx-jitter-bfr" class="config-select-large" name="multiroom_rx_jitter_bfr" onchange="autoClick('#btn-set-multiroom-rx-jitter-bfr');">
						$_select[multiroom_rx_jitter_bfr]
					</select>
					<button id="btn-set-multiroom-rx-jitter-bfr" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_multiroom_rx_jitter_bfr" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
					<span class="config-help-static">
						Length of the RTP jitter compensation buffer in milliseconds.
					</span>
				</div>

				<label class="control-label" for="multiroom-rx-frame-size">Opus帧大小 (ms)</label>
				<div class="controls">
					<select id="multiroom-rx-frame-size" class="config-select-large" name="multiroom_rx_frame_size" onchange="autoClick('#btn-set-multiroom-rx-frame-size');">
						$_select[multiroom_rx_frame_size]
					</select>
					<button id="btn-set-multiroom-rx-frame-size" class="hide btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_multiroom_rx_frame_size" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
					<span class="config-help-static">
						Length of PCM data in milliseconds to be decoded from an Opus frame.
					</span>
				</div>

				<label class="control-label" for="multiroom-rx-rtprio">实时优先级</label>
				<div class="controls">
					<input id="multiroom-rx-rtprio" class="input-small" type="number" maxlength="2" min="1" max="99" name="multiroom_rx_rtprio" value="$_multiroom_rx_rtprio">
					<button class="btn btn-primary btn-small config-btn-set btn-submit" type="submit" name="update_multiroom_rx_rtprio" value="novalue"><i class="fa fa-solid fa-sharp fa-arrow-turn-down-left"></i></button>
					<span class="config-help-static">
						Realtime process priority for the Receiver daemon. Priorities range from 1 - 99 where higher priority preempts lower priority.
						Scheduler policy is FIFO and default priority is 45.
					</span>
				</div>
			</div>
		</div>
	</form>
</div>
</div>

<form class="form-horizontal" method="post">
	<div id="restart-tx" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="restart-tx-label" aria-hidden="true">
		<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			<h3>重启发送器?</h3>
		</div>
		<div class="modal-body"></div>
		<div class="modal-footer">
			<button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
			<button class="btn btn-primary btn-submit" type="submit" name="multiroom_tx_restart" value="1">确认</button>
		</div>
	</div>
</form>

<form class="form-horizontal" method="post">
	<div id="restart-rx" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="restart-rx-label" aria-hidden="true">
		<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			<h3>重启接收器?</h3>
		</div>
		<div class="modal-body"></div>
		<div class="modal-footer">
			<button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
			<button class="btn btn-primary btn-submit" type="submit" name="multiroom_rx_restart" value="1">确认</button>
		</div>
	</div>
</form>
